home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-10-23 | 5.0 KB | 154 lines | [TEXT/CCL2] |
- (in-package :oou)
- (provide :video-svm)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; :video-svm.lisp
- ;;
- ;; Copyright © 1991 Northwestern University Institute for the Learning Sciences
- ;; All Rights Reserved
- ;;
- ;; author: Michael S. Engber
- ;;
- ;; mixin for adding video to views
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (oou-dependencies
- :video-player
- :video-digitizer-svm
- )
-
- (export '(video-svm
- ))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- #|
-
- This mixin facilitates display video in views. It's a specialization of
- video-digitizer-svm, which incorporates control over the video player,
- along with control of the on screen digitizing.
-
- It uses a slot to hold a player object and provides methods which issue
- the basic video commands to this player object. More control can be
- achieved by manipilating the player object directly.
-
-
- See Also
- video-digitizer-svm - inherited behavior
- video-player - for more info on video player objects
- ??-vp - board-specific -vp files for individual player classes.
-
- Initargs
-
- :player-class [none]
- The class of video player object to use.
- (e.g. 'P330-vp for a Pioneer 330 laserdisk juke-box/boat-anchor)
-
- :player-object [none]
- This initarg can be used to provide an already existing player object.
- Allows multiple views to share a common player object. For shared player
- objects you may want to use a nil :dispose-vd-on-remove-p. See below.
-
- :dispose-vp-on-remove-p [t]
- This flag determines if vp-dispose is called on the player object
- when the view is removed from it's window.
-
- All the video-digitizer-svm initargs are accepted
-
- All the video-player initargs are also accepted and used in
- creating the player object. (the entire initarg list is passed along)
-
- All the video-digitizer initargs are also accepted and used in
- creating the digitizer object. (the entire initarg list is passed along)
-
-
- Methods of Interest
-
- vp-load
- vp-loaded-p
- vp-features
- vp-seek
- vp-play
- vp-play-clip
- vp-scan
- vp-jump
- vp-step
- vp-stop
- vp-freeze
- See video-player for descriptions of these methods. The video-svm versions.
- behave the same + appropriate calls to the digitizer. (e.g. vp-play also
- starts digitizing, vp-stop also stops digitizing, ...)
-
- |#
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (defclass video-svm (video-digitizer-svm)
- ((player-class :initarg :player-class)
- (player-object :initarg :player-object
- :accessor player-object)
- (dispose-vp-on-remove-p :initarg :dispose-vp-on-remove-p)
- )
- (:default-initargs
- :dispose-vp-on-remove-p t))
-
- (defmethod initialize-instance :after ((sv video-svm) &rest initargs
- &key
- &allow-other-keys)
- (declare (dynamic-extent initargs))
- (unless (slot-boundp sv 'player-object)
- (setf (player-object sv)
- (apply 'make-instance (slot-value sv 'player-class)
- :allow-other-keys t
- initargs))))
-
- (defmethod install-view-in-window :after ((sv video-svm) window)
- (declare (ignore window))
- (vp-init (player-object sv)))
-
- (defmethod remove-view-from-window :before ((sv video-svm))
- (with-slots ((vp player-object)) sv
- (vp-stop vp)
- (when (slot-value sv 'dispose-vp-on-remove-p) (vp-dispose vp))))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (defmethod vp-load ((sv video-svm) &rest rest &key &allow-other-keys)
- (apply 'vp-load (player-object sv) rest))
-
- (defmethod vp-loaded-p ((sv video-svm))
- (funcall 'vp-loaded-p (player-object sv)))
-
- (defmethod vp-features ((sv video-svm))
- (funcall 'vp-features (player-object sv)))
-
- (defmethod vp-seek ((sv video-svm) frame &rest rest &key &allow-other-keys)
- (apply 'vp-seek (player-object sv) frame rest))
-
- (defmethod vp-play ((sv video-svm))
- (funcall 'vp-play (player-object sv))
- (unless (digitizing-p sv) (start-digitizing sv)))
-
- (defmethod vp-play-clip ((sv video-svm) start-frame end-frame &rest rest &key &allow-other-keys)
- (apply 'vp-seek (player-object sv) start-frame end-frame rest))
-
- (defmethod vp-scan ((sv video-svm) direction speed-x)
- (funcall 'vp-scan (player-object sv) direction speed-x)
- (unless (digitizing-p sv) (start-digitizing sv)))
-
- (defmethod vp-jump ((sv video-svm) direction frame-count)
- (funcall 'vp-jump (player-object sv) direction frame-count)
- (unless (digitizing-p sv) (grab-one-frame sv)))
-
- (defmethod vp-step ((sv video-svm) direction)
- (funcall 'vp-step (player-object sv) direction)
- (unless (digitizing-p sv) (grab-one-frame sv)))
-
- (defmethod vp-stop ((sv video-svm))
- (when (digitizing-p sv) (stop-digitizing sv))
- (funcall 'vp-stop (player-object sv)))
-
- (defmethod vp-freeze ((sv video-svm))
- (when (digitizing-p sv) (stop-digitizing sv))
- (funcall 'vp-freeze (player-object sv)))
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- #|
- an example can be found in video-example.lisp
- |#